`timescale 1ns / 1ps

module hlswarpper_reduceWidth (
		ap_clk,
		ap_rst,
		ap_start,
		ap_done,
		ap_continue,
		ap_idle,
		ap_ready,
		ap_ce,
		in_data,
		in_empty_n,
		in_read,
		out_data,
		out_full_n,
		out_write
);

parameter integer IN_W		= 32;
parameter integer OUT_W		= 8;
parameter integer VEC_LEN	= 172800;

input				ap_clk;
input				ap_rst;
input				ap_start;
output				ap_done;
input				ap_continue;
output				ap_idle;
output				ap_ready;
input				ap_ce;
input	[IN_W-1:0]	in_data;
input				in_empty_n;
output				in_read;
output	[OUT_W-1:0]	out_data;
input				out_full_n;
output				out_write;

wire i_vld;
wire i_rdy;
wire o_vld;
wire o_rdy;

reduceWidth #(
    .N      (IN_W / OUT_W), 
    .WIDTH  (OUT_W)
)inst_reduce
(
    .clk(ap_clk),
    .rst(ap_rst),
    .i_vld(i_vld),
    .i_rdy(i_rdy),
    .i_data(in_data),
    .o_vld(o_vld),
    .o_rdy(o_rdy),
    .o_data(out_data)
);

vldrdy2apfifo inst_fifosignal
(
    .in_empty_n(in_empty_n),
    .in_read(in_read),
    .out_full_n(out_full_n),
    .out_write(out_write),
    
    .i_vld(i_vld),
    .i_rdy(i_rdy),
    .o_vld(o_vld),
    .o_rdy(o_rdy)
);

aphs_interface #(
    .OUT_LEN(VEC_LEN)
) inst_aphs
(
    .ap_clk(ap_clk),
    .ap_rst(ap_rst),
    .ap_start(ap_start),
    .ap_done(ap_done),
    .ap_continue(ap_continue),
    .ap_idle(ap_idle),
    .ap_ready(ap_ready),
    .ap_ce(ap_ce),
    .out_succ(out_write)
);

endmodule
